import javax.microedition.lcdui.Canvas;
import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;
import java.util.Vector;

public class SplashPresentation extends Canvas
{

	private MenuManager mgr;
	
	public SplashPresentation(MenuManager mm)
	{
		this.mgr = mm;
	}

	protected void keyReleased(int keyCode)
	{
		/* Cancel */
		mgr.itemSelected(keyCode);
	}

	
	public void paint(Graphics g)
	{
		
		int w = getWidth();
		int h = getHeight();
		int emh = h / 6;
		int emw = w / 5;
		
		g.setColor(mgr.getDefaultBGColor());
		g.fillRect(0,0, getWidth(), getHeight());
		
		g.setColor(0x00FFFFFF - g.getColor());
	
		g.drawString("{ pritisni 0 za izhod }", w / 2 , 6 * emh, Graphics.BASELINE | Graphics.HCENTER);
		int visinae = h / 9;
		int sirinae = w / 6;
		
		g.drawLine(w / 2, emh + visinae, w / 2, emh * 3);
		g.drawLine(w / 2 - emw, emh *  2 + visinae / 2, w / 2 + emw, emh * 2 + visinae / 2);
		
		g.drawArc(w / 2 - (sirinae / 2), emh, sirinae, visinae, 0, 360);
		g.drawArc(w / 2 + emw, 2 * emh, sirinae, visinae, 0, 360);
		g.drawArc(w / 2 - emw - sirinae, 2 * emh, sirinae, visinae, 0, 360);
		g.drawArc(w / 2 - (sirinae / 2), 3 * emh, sirinae, visinae, 0, 360);
		g.drawArc(w / 2 + emw, 4 * emh, sirinae, visinae, 0, 360);
		g.drawArc(w / 2 - emw - sirinae, 4 * emh, sirinae, visinae, 0, 360);

		g.drawString("2", w / 2, emh + (visinae / 2), Graphics.BASELINE | Graphics.HCENTER);
		g.drawString("8", w / 2, 3 * emh + (visinae / 2), Graphics.BASELINE | Graphics.HCENTER);
		g.drawString("4", w / 2 - emw - (sirinae / 2), 2 * emh + (visinae / 2), Graphics.BASELINE | Graphics.HCENTER);
		g.drawString("6", w / 2 + emw + (sirinae / 2), 2 * emh + (visinae / 2), Graphics.BASELINE | Graphics.HCENTER);
		g.drawString("7", w / 2 - emw - (sirinae / 2), 4 * emh + (visinae / 2), Graphics.BASELINE | Graphics.HCENTER);
		g.drawString("9", w / 2 + emw + (sirinae / 2), 4 * emh + (visinae / 2), Graphics.BASELINE | Graphics.HCENTER);
		
		g.drawString("{crn zaslon}", w / 2 - emw - (sirinae / 2), 5 * emh, Graphics.BASELINE | Graphics.HCENTER);
		g.drawString("{bel zaslon}", w / 2 + emw + (sirinae / 2), 5 * emh, Graphics.BASELINE | Graphics.HCENTER);

	}
}
